package com.david.rabbit.spring.xml.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;

/**
 * @author David
 * @version V1.0
 * @Package com.david.rabbit.spring.xml.listener
 * @date 2021/7/17 16:21
 */
public class MyMessageListener implements ChannelAwareMessageListener {

    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println("MyMessageListener:"+new String(message.getBody(), message.getMessageProperties().getContentEncoding()));
    }
}
